home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / fragment tool / prototypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  6.6 KB  |  209 lines

  1. /*
  2.     File:        Prototypes.h
  3.  
  4.     Contains:    Routine prototypes
  5.  
  6.     Written by: Chris White    
  7.  
  8.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/5/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24.  
  25.  
  26. #ifndef __PROTOTYPES__
  27. #define __PROTOTYPES__
  28.  
  29.  
  30.  
  31. #ifndef __TYPES__
  32.     #include <Types.h>
  33. #endif
  34.  
  35. #ifndef __WINDOWS__
  36.     #include <Windows.h>
  37. #endif
  38.  
  39. #ifndef __WINDOWS__
  40.     #include <Files.h>
  41. #endif
  42.  
  43.  
  44.  
  45. #ifndef __FRAGMENTTOOL__
  46.     #include "FragmentTool.h"
  47. #endif
  48.  
  49. #include "FragmentStuff.h"
  50.  
  51.  
  52.  
  53.  
  54. #if DEBUGGING
  55. void DebugStrNum ( Str255 str, long num );
  56. #endif
  57.  
  58.  
  59.  
  60.  
  61. // Initialization.c
  62. void InitToolbox ( void );
  63. void InitApplication ( void );
  64. static Boolean CheckConfiguration ( void );
  65.  
  66.  
  67. // AppleEvents.c
  68. void InstallAppleEventHandlers(void);
  69.  
  70.  
  71. // Drag.c
  72. OSErr InstallDragHandlers ( WindowRef theWindow );
  73. void RemoveDragHandlers ( WindowRef theWindow );
  74. OSErr InitDragHandlers ( void );
  75.  
  76. // DialogsStuff.h
  77. void DoDialogContentClick ( DialogRef theDialog, EventRecord* theEvent );
  78. void DoDialogItemHit ( DialogRef theDialog, int16 theItem );
  79. OSErr AddHFSPromise ( DragReference theDrag, ItemReference theItem );
  80.  
  81.  
  82. // Fragments.c
  83. OSErr ParseResource ( Handle theResource, tHeaderHan privateData );
  84. OSErr BuildResource ( tHeaderHan privateData, Handle theResource );
  85.  
  86. OSErr CopyFragment ( tHeaderHan sourceHeader, FSSpecPtr sourceSpec, int16 sourceIndex,
  87.                         tHeaderHan targetHeader, FSSpecPtr targetSpec );
  88. OSErr DeleteFragment ( tHeaderHan theHeader, FSSpecPtr theSpec, int16 theIndex );
  89. tItemPtr GetNthItem ( tHeaderHan theHeader, int16 theIndex );
  90. tItemPtr GetLastItem ( tHeaderHan theHeader );
  91. int16 GetItemCount ( tHeaderHan theHeader );
  92.  
  93. OSErr AppendFileData ( FSSpecPtr source, FSSpecPtr target, long* offset, long* length );
  94.  
  95. OSErr IncrementTempUsageCount ( tItemPtr theItem );
  96. OSErr DecrementTempUsageCount ( tItemPtr theItem );
  97. int GetTempUsageCount ( tItemPtr theItem );
  98. FSSpecPtr GetTempSpecPtr ( tItemPtr theItem );
  99.  
  100.  
  101. // Menus.c
  102. void MenuDispatch ( int32 menuResult );
  103. void AdjustMenus ( void );
  104.  
  105.  
  106. // Windows.c
  107. void DoNewDocument ( void );
  108. void DoOpenDocument ( void );
  109. OSErr OpenDocument ( FSSpecPtr fileSpec, StringPtr documentName );
  110.  
  111.     // Did the user cancel?
  112. Boolean DoCloseAllDocuments ( void );
  113. Boolean DoCloseDocument ( WindowRef theWindow );
  114. Boolean DoSaveBeforeClosing ( WindowRef theWindow );
  115. Boolean DoSave ( WindowRef theWindow );
  116. Boolean DoSaveAs ( WindowRef theWindow );
  117.  
  118. Boolean IsDocumentDirty ( WindowRef theWindow );
  119. void SetDocumentDirty ( WindowRef theWindow, Boolean bIsDirty );
  120.  
  121. void AddFragToList ( ListRef theList, tItemPtr theItem );
  122. void UpdateFragInList ( WindowRef theWindow, int16 theIndex, StringPtr newName );
  123.  
  124. OSErr CreateWindowInfo ( WindowRef windowRef, Size infoSize );
  125.  
  126. OSErr CopyWindowFragment ( WindowRef source, int16 sourceIndex, WindowRef target );
  127. OSErr MoveWindowFragment ( WindowRef source, int16 sourceIndex, WindowRef target );
  128. OSErr DeleteWindowFragment ( WindowRef theWindow, int16 theIndex );
  129. tItemPtr GetNthWindowItem ( WindowRef theWindow, int16 theIndex );
  130. int16 GetIndexFromNthWindowItem ( WindowRef theWindow, int16 theIndex );
  131.  
  132.  
  133. // Lists.c
  134. void InitListClickLoop ( void );
  135. void AddToList ( ListRef theList, Str255 theString );
  136. void UpdateList ( ListRef theList, int16 theIndex, Str255 theString );
  137. void DeleteFromList ( ListRef theList, int16 theIndex );
  138. Boolean HandleListClick ( WindowRef theWindow, EventRecord* event );
  139. Boolean PtInList ( Point localPt, ListRef theList );
  140. void GetListRect ( Rect* theRect, ListRef theList );
  141. Boolean GetFirstSelection ( ListRef theList, Cell* theCell );
  142. Boolean GetSelection ( ListRef theList, int16* theIndex );
  143.  
  144.  
  145.  
  146. /*
  147.     TO DO:
  148.         Sort this lot out
  149. */
  150.  
  151.  
  152. void SetWListRef ( WindowRef theWindow, ListHandle theList );
  153. ListHandle GetWListRef ( WindowRef theWindow );
  154.  
  155.  
  156. OSErr CreateDocumentWindow ( WindowRef* windowRef, Str255 windowTitle,
  157.                                 tContentsProcPtr contentsProc, void* refCon );
  158. WindowRef DestroyDocumentWindow ( WindowRef windowRef );
  159.  
  160. Boolean IsMovableModal ( WindowRef theWindow );
  161. void DrawClippedGrowIcon (WindowRef wp);
  162. WindowRef CreateNewDocument ( void );
  163. void OpenNewDocument ( void );
  164. void DoUpdate ( EventRecord *theEvent );
  165. void DoActivate (EventRecord *theEvent);
  166. void DoContentClick (WindowRef wp, EventRecord *theEvent);
  167. void DoGrowWindow(WindowRef wp, EventRecord *theEvent);
  168. void DoDragWindow(WindowRef wp, EventRecord *theEvent);
  169. void DoZoomWindow(WindowRef wp, EventRecord *theEvent, int16 WindowPart);
  170. void DoIdleWindow (WindowRef wp);
  171. void ClipToContentArea (WindowRef wp);
  172. void ResetClip (WindowRef wp);
  173. ListHandle GetWListRef ( WindowRef theWindow );
  174. void SetWFileRef ( WindowRef theWindow, int16 theFileRef );
  175. int16 GetWFileRef ( WindowRef theWindow );
  176. void SetWFileSpec ( WindowRef theWindow, FSSpecPtr theSpec );
  177. DialogRef CreateExportsDialog ( Str255 theDocTitle );
  178. OSErr CreateListDialog ( DialogRef* dialogRef, int16 dialogID, StringPtr dialogTitle,
  179.                             tContentsProcPtr contentsProc, void* refCon );
  180. OSErr CreateInfoDialog ( DialogRef* dialogRef, StringPtr dialogTitle, WindowRef theWindow, int16 theIndex );
  181. void SetWindowType ( WindowRef theWindow, int16 theType );
  182. int16 GetWindowType ( WindowRef theWindow );
  183. void SetWindowSubType ( WindowRef theWindow, int16 theType );
  184. int16 GetWindowSubType ( WindowRef theWindow );
  185. pascal void OutlineUserItem ( DialogRef theDialog, short theItem );
  186. StringPtr ConcatPStr ( Str255 ioFirstStr,Str255 inSecondStr, int16 inDestSize );
  187. StringPtr CopyPStr ( Str255    inSourceStr, StringPtr outDestStr, int16 inDestSize );
  188. StringPtr OSTypeToPStr ( OSType inOSType, StringPtr outString );
  189. DialogRef DestroyDialog ( DialogRef theDialog );
  190. OSErr AddFragments ( ListRef theList, void* refCon );
  191. OSErr AddFragmentExports ( ListRef theList, void* refCon );
  192. OSErr AddDocuments ( ListRef theList, void* refCon );
  193. WindowRef GetIndexedDocumentWindow ( int theIndex );
  194. void MoveCopySelectedFragments ( DialogRef theDialog, Boolean bMove );
  195.  
  196. OSErr SetDialogValues ( DialogRef theDialog, tItemPtr theItem );
  197. OSErr GetDialogValues ( DialogRef theDialog, tItemPtr theItem );
  198.  
  199.  
  200. void AddFragToList ( ListRef theList, tItemPtr theItem );
  201. void DeleteFragFromList ( ListRef theList, int16 theIndex );
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. #endif // define __PROTOTYPES__
  209.